﻿CREATE TABLE [dbo].[UserEnvironmentRights] (
    [Id] [int] NOT NULL IDENTITY,
    [TargetEnvironmentID] [int] NOT NULL,
    [UserEnvironmentId] [int] NOT NULL,
    [Right] [int] NOT NULL,
    CONSTRAINT [PK_dbo.UserEnvironmentRights] PRIMARY KEY ([Id])
)
CREATE INDEX [IX_TargetEnvironmentID] ON [dbo].[UserEnvironmentRights]([TargetEnvironmentID])
CREATE INDEX [IX_UserEnvironmentId] ON [dbo].[UserEnvironmentRights]([UserEnvironmentId])
CREATE TABLE [dbo].[UserEnvironments] (
    [Id] [int] NOT NULL IDENTITY,
    [Username] [nvarchar](max),
    CONSTRAINT [PK_dbo.UserEnvironments] PRIMARY KEY ([Id])
)
ALTER TABLE [dbo].[DefaultSettingParameterValues] ADD [LastUpdatedBy] [nvarchar](max) DEFAULT 'migration'
ALTER TABLE [dbo].[IntegrationVersionParameterValues] ADD [LastUpdatedBy] [nvarchar](max) DEFAULT 'migration'
ALTER TABLE [dbo].[TargetEnvironments] ALTER COLUMN [Name] [nvarchar](50) NULL
ALTER TABLE [dbo].[UserEnvironmentRights] ADD CONSTRAINT [FK_dbo.UserEnvironmentRights_dbo.UserEnvironments_UserEnvironmentId] FOREIGN KEY ([UserEnvironmentId]) REFERENCES [dbo].[UserEnvironments] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[UserEnvironmentRights] ADD CONSTRAINT [FK_dbo.UserEnvironmentRights_dbo.TargetEnvironments_TargetEnvironmentID] FOREIGN KEY ([TargetEnvironmentID]) REFERENCES [dbo].[TargetEnvironments] ([Id]) ON DELETE CASCADE
INSERT [dbo].[__MigrationHistory]([MigrationId], [ContextKey], [Model], [ProductVersion])
VALUES (N'201509101045034_ChangedUserDbEntry', N'DevWeb.Biztalk.DeploymentSettings.Data.CodeFirst.Migrations.Configuration',  0x1F8B0800000000000400ED1DCB6EE4B8F11E20FF20E89404B36EDB930112A3BD0BAF3DB330321E0FDC339BDC16B444B785554BBD7A1876827C590EF9A4FC4228B5D42D8914597C496A4FDFEC165924EBC5621559F5BFFFFC77FEC3F32A749E7092067174EE9E1C1DBB0E8EBCD80FA2E5B99B670FDFFDC5FDE1FBDFFF6EFEDE5F3D3B3FD7EDDE16ED48CF283D771FB36C7D369BA5DE235EA1F4681578499CC60FD99117AF66C88F67A7C7C77F9D9D9CCC3001E112588E33BFCBA32C58E1F21FF2EF651C79789DE528BC897D1CA6D5EFE4CBA284EA7C422B9CAE9187CFDD2BFCF4777C7FF463F0CF0C85BF1E5DE17518BFAC70942D70969159A747572843479704D087204933F25794E1E7CC752EC20091F92E70F8E03A288AE20C656435675F53BCC892385A2ED6E407147E795963D2EE018529AE5679B66B0E5DF0F169B1E0D9AE630DCACBD32C5E49023C795B6170D6EDAE4407778B6182E3F78416D94BB1EA12CF058A1F501ED608FD8C12F26B8613D7E98E7D761926453F05AAF48CF1C69185F466CB9584798F4E8F8EDF389704709EE0F308E75982C237CEE7FC3E0CBCBFE1972FF1AF383A8FF2306C6280E0807C6BFD407EFA9CC46B9C642F77F8A1C2CBB5EF3AB376BF59B7E3B65BA3CF0645D751F6F6D4753E91C1D17D88B70CD640E7228B13FC138E708232EC7F4619C14854C0C02589A8D13B636DB158FC5B0F4B589B60CD756ED0F3471C2DB3C773F7DD3191DE0FC133F6EB5FAAA97C8D0222FAA45396E458345A45C19F5198F306237FAA0CF6093D05CB122BEC61BB8C534E23759D3B1C96BDD2C760BD91F53E56FB4500E94312AFEEE2B07F483E805F16719E780566621D285F50B2C4591B3DF3D94E645504B922997D692E073A88B48648F720563C053ED80D57BD8F9E02B2EF1594D00568490B7446B94C30C1226116FC25D869B8DDFF9293FE88D2ECEBDA2F08F3E3CBF82A6C4ACAAB563B7ACAAB568150C4506CC94409D50A8E0CC9AE141A64FBB31000D6DE0C6C1854D914F4839ED6D0D3428BCB88C1957A49B0DE18FD968D3B5D4D6BD07C1B50DCBB269BAABA8023A396B08FF112BEFA7627FE729B6D41EB6B75905D101134BC4CCA2F956A50A330000E6FD9C2EE004C8861C822E76B8A93C60877C1F2318322A4A72F0F09CC2E8085B3FB699E431A5C65F8E0D1807CD8C13476B0621CCEB672626053B941DE63106143DE094963DFF0D961C35A828383A5A5183FBDD1BA4E1AA2C496C054797433CE46276C4C19EEE21EC39D5594B76FC86944B826B0D26611CEA0E6A6C11FD4B78EEF3789FDDC6B68829FF2C09777E3D4846EABB4223E9327098EBC979B526D953A4DC94722AD66F7E7CCD3AFF8CC6953C089C1B026ED1A8C70DDABB0434017D4EAC25D4DE327C8529ACD0D1E7EC094E2C380AE94EA2AB974BABF96F9DFA2969D2DE4B077D8735E99F1DD0FA9C9ABCDF0EB9A70878F0B926BED8AD69C61B4C8A9280A090D08308B590AD390FD68E72601679C8356D0D00A060E858AF7134E81EE72695BD2E68585F174C6D8B6859C52E9B74DEC3A9939BDE4DCCD5A800086980C3453661913FC505AFA704BC4BCAA3EDC1479153745B836D474959C7847505199B63DB3D6838E62FFAD1A32C01A9F15DA33AAE559031C34BB4E548E52BF577AEAB743215D6D5EB150A5100BB92A06A87E55B6715525D858945C2CA9FCE8BAE29500E6323B6DC48B0475A09608EB6552FDD8D43C07A5A3A1740A5C46567C8206EEC6581287EEB94C4E8860E290AF3AC250E9C9EBF4438896698D33C35231F0264C38C0C749F8424036F9B5CD073778758F9396ADEE3AA58553DE3499715ADF61E46FDB9EF2DB6E4CF66DEBB7FCD65738C48DD67FE6B7BE28D65A357D4773C086D6CD1F2FD234F68292A27DDB9CE066637B36EF23DFD1BCE6B8DBB5193BEE0D0110AC097D092F1754E9EAB5DB688330E7C22BD644E888520FF9B4D0136CF8A6A6BEDDB57653E73F7269AFE24FD4E48856C649A116517849F40CE1EB20CA68151E445EB046A11EC23B60817B4381C1ED04BA5F8818E3A850EB7AF884CC8CE909A0A7BA9D51870944889ECF1A02C2971B7184BB8FDD24C2DD3B0663795C07110E896B4E4D7168DDB5B4C2FF60340EC0F1602481E6C28C794C85C99B313F099E615E8190616F9A6BC0E33118B415B9B42847A6389BB19C71D89A4147499E9E1033CBF825E1BCA71489E18942C3DD3A92CA57F2BB829664D34232429A51C44C01DF6A3B4B2B443311A9E4C788D5F600CE65B469DA58B060B792D6B0677F41103EFAB6D58BCE3DB3CD84B7FA658EBBA2E3C7948EE653387C407138D2695BF5E8319DE3B54A6414CE444A86D97464609F8C300DE48F223C460DAEE9C8132C62D1C78292E18B7620767889910C3EF64EB70A8D58910B29940E2009523883CC8711E49FC84E22C7FBD28FDAA7B8634C510224113BCA6EA02D05CCBB33A3C8815A12A73E16D34C47278C9C0D24299A89A9460D006A91600069D2C22D647E9CBC740348D8E6824591D895F468C4EFBB571AB6A95FA92B1544B954B72AEA6B175D362D462070F8EB4D5D6777D9432455540C0534447DF5143A4EC5F682C128DDC81A81B1870AD7D07E68CC9874CB412000C77C1F47C164F90EE180051015E6C8E50EAEB3507DA85E2E111F3D0583F6DCAFA206625B2F72C0017029900D15C1616F51CEB00614C5B4635DADA77F3D678B2CB6B8527A56FF564D634401BEBAFB7C9B0A000A89EF7030682279F143E4E8EFF1BD36B0C054401CC4C36F6CB450DD5EB70DDCB6341A08B1BD970D24C2279650CABA60C01EC10E36A5DED44090AD1C0CB7100EE792AAB9B549D14C258A0D9B894D8DC44780AC180902AA4642AAD604AD3F12AAC8300A141227D3826DE3C01D031CAC33BB510FBE5D28BD8483605A4799E9048E4CD263B2EA0AF80E82A6934238422320D1C00A6DEC7328211747E81FA5C683052901635CC90DAEE508372901A3635E31053E4D07036E58838E58F1618B4F293DFFA985A35EFDF069EB97DB7E9BCF36759CAA1FE6B39E824FF31BB45E178EBB5DCFEA1767B1A9FE74F9DD42BEE0D16A0363E6B588D9F5226E47CAE2042D71E72B19BA7E1955BC93BA47C563B74B7F4535EBF742F6B842EA71058E469A116A47490DA0F8BB06A25623ABD77749BB84AB413F105415804BAC613153D1909CA2C8170A51C278F0781987F92AEAF788F7F7EEA41A6A02EA7C82C36CE70F6A826C7FA121CE671D74512E728A9A541CA5CD2D3ABCD4ABD78663A80DA68C71550F383BACC5097D3078021221E91F8B7989A5390AE8964B3F7C062FF732711F8C6EAA9526B0EE3738D44EC69526D0CEA7C9881BC3D21A44C6E8308DBC600160D891265A3FCBABE54662C9B604363E0CC5CFA3A97A8153C38A6E6FC6F2549439B7BF1D7EDB943968A9D0F217388456158326A0D687B1F567B33E415B2876BF4F671F62DFED6F511974FB7F34F963395B07114246F05B5E1221402CD9E9BBB4F52D1B7DF7B384315307FF5BE60CFB46000FCEB4361480C8706465AA4232BC74E889C5B76B0EB172693344B5F5FD951B5B9231BD41B4BE8EAF460A9A1DBE376700EC8747E85B9187217D4DC2AB6E462563509F93E0F5385F4E0EBEA7D7EF7B8206142D881DF3E2A7BCA8C1C058720AB05E8AF0599DF194A41F3EE33D56133AE0B9563FECEAA26D131EF3EEED7498731CBED467C9A1B871977EB3CB24518F7D6295AE5458B7DB643BFA36BCDB09E3CEAB906A2BD65BAEBE88DC96AB4EABF06E37C6BA69E23A04454F815FC457172F6986571BA22F7E0B2FC3A020CDB6C10D8A82079C669B8C94EEE9F1C9A9EB5C84014A379700AAE8F159F74508289C7CF2B60827637F35EB76970F4A1750D2D40F1921E956E55C40187588ACB3418164615E59130561A22794788F28A1EB42EDA0C30A4ED1E55E6AD87F58A1E73FF2014A143786C624F7964E9C58666354EA91D575E4E3E773F75F259433E7FA1F7D7753AEFD37CE6D42A4F7CC3976FE6DB2460574620C105A5352E53A1A12BB9245618166C62A59D8100B4144716F6501A0AAE43515551ACF9412D4E21EC5FAEEAF83CE9BB020871A27B2B460943F879059A344A1B296A0AB9B1B9BE9049535DBB5283727160C8949E954E57E1DF2F6B95BC03A8F82DF721C94F01E82E279AC5E31EBDE4D4EB510F5247434979BB5D8D83AFFBE12C665E973254BCF228BB1827486A46C180B031CA2DA5B369AC026A473403F7D276F0A689ED027C88BAFE9D02F0824E972E6E1F0FF8A0FFFE260CEDE8A05A7229F3ABF5D69F11B237E2437210A80D6745A3501CB2998D1BBDC70CCDEF253B7D89A01711CB0D2D424722EF233618D9B290EF23863A8F46F7DB760A69C3C5732E50F379FC5342A0E7452A00D9C3D1D745FDC0243F29F8A4C3ADBBF4C722436FF8D52FFC8A02498E7BD716A511CEA25F5E71E84E6281CBB0C12BDAB8B1B0F5DE268E4CA45F07D5EF2B2E804D4AD4E55A269ECFF16A470AF6D036D399A8EA560AE2ED044CE55635AAA239D9C640DD5E91C95ACD6ED990443EE8359300ADB1A3106A6C3C9462BE64CAF284ECB413A72F19B11EADBF4BD10A1C77DB5756C26A14DA7C495A3684D65BEFCC62ACB4CBF68CC245CFDF0E479D373F84FB19E0B9D70B1CB15A0022A32255A36CF8DCE5DFF3E26DCB489BB4193734A157491AEE72231B39EC49DDDE931B61D6A4E8C36AC898873CCF22BC5880BC5B097CF4D84DD1D91E5F0A1866535628DCD6A071F5F54724630A2C25279D2C06D0D5BBC8454888F653213E448877C12EEEE54D9F60F353D7633D69460199205D380D4C8010C4E8FBB879574F899AE197B17D492688095AAB3B597857004B9EB056864E871467A3F2B886AE9443B556DFA70C3458A368ABFD13235D0220A92C8E708B7B8B165BE1DBDAE8C8EF05B20E51E9685D1DA8486D29EFB51E44503955313FBA9D467E195E8E0229467FDF667ECB1C1A963165AD1E0C8B110B86FF55220D6F6A44C7989422774E69BF9EC2E8F8AD71B9BFFAE701A2C7720E6046684BD96836CDBE63A7A886BD75D67467593EE93739C211F65E822C98207E465E4B387D3942CDE75CA559FBBEF57F7D8BF8E6EF36C9D6764C978751FB6329B15FE3EDEF8653597F69CE7B7E52BC6D4C412C83483E2C5CA6DF4631E84FE76DE1F182F097A40148EC4EAC67E41CBACB8B9BF7CD942FA1447404015FAB6FECF2F78B50E09B0F4365AA027AC3237A2033EE225F25EEA0446FD40C48468A37D7E1520B2C9ADD20AC6AE3FF997F0B0BF7AFEFEFFCC5439EA03D20000 , N'6.1.3-40302')

